package com.coscon.test;

import java.awt.*;
import java.awt.event.InputEvent;

public class SystemVolShellTest1 {

    public static void pressKey(Robot robot,int[] keys,int delay){
        for(int i=0;i<keys.length;i++){
            robot.keyPress(keys[i]);
            robot.keyRelease(keys[i]);
            robot.delay(500);
        }
        //处理完需要延迟
        robot.delay(delay);
    }

    public static void clickMouse(Robot robot,int x,int y,int delay){
        robot.mouseMove(x, y);
        robot.delay(100);
        robot.mousePress(InputEvent.BUTTON1_MASK);
        robot.mouseRelease(InputEvent.BUTTON1_MASK);
        robot.delay(delay);
    }

    public static void main(String[] args) {
        try {
            Robot robot = new Robot();
            Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
//
            int width = d.width;
            clickMouse(robot, width-170, 15, 100);

        } catch (AWTException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
